package com.pay.bean;

import com.tmt.annotation.EnumDescriptor;
import com.tmt.annotation.parser.EnumAnnotationParser;

/**
 * 交易状态
 * Created by ThreeManTeam on 2017/4/27.
 */
public enum TradeState {

	/**
	 * 创建交易后没有支付，一定时间没有支付后将转为交易关闭
	 */
	@EnumDescriptor(title = "支付中", description = "支付中")
	PAYING,

	@EnumDescriptor(title = "交易超时", description = "交易超时")
	TRADE_TIMEOUT,

	@EnumDescriptor(title = "交易成功", description = "交易成功")
	TRADE_SUCCESS,

	@EnumDescriptor(title = "交易失败", description = "交易失败")
	TRADE_FAIL;

	public static TradeState from(String title) {
		return EnumAnnotationParser.convertFromTitle(TradeState.class, title);
	}

}
